<html>
    <head>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/engine.js'></script>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/util.js'></script>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/interface/Greeting.js'></script>
	
	<title>Greeting</title>
	<script language="JavaScript">
	    dwr.engine.setActiveReverseAjax(true);
	    function sayHello() {
		Greeting.sayHello(dwr.util.getValue("message"), function(data) {
		    addMsg(data);
		});
	    }
	    function addMsg(msg) {
		var ele = document.getElementById("messages");
		ele.value = ele.value + msg + "\n";
	    }
	</script>
    </head>
    
    <body >
	<br/>
	Name: <input type="text" id="message" onkeypress="dwr.util.onReturn(event, sayHello)"/>
	(Please enter "Enter" key)
	<br/>
	<textarea id="messages" cols="50" rows="10"></textarea>
	<br/>
	<input type="button" value="Clear" onclick="document.getElementById('messages').value=''"/>
    </body>
</html>
